import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/basic_information/interlock_removal_ledger_entity.dart';

InterlockRemovalLedgerEntity $InterlockRemovalLedgerEntityFromJson(Map<String, dynamic> json) {
  final InterlockRemovalLedgerEntity interlockRemovalLedgerEntity = InterlockRemovalLedgerEntity();
  final int? auditStatus = jsonConvert.convert<int>(json['auditStatus']);
  if (auditStatus != null) {
    interlockRemovalLedgerEntity.auditStatus = auditStatus;
  }
  final String? companyCode = jsonConvert.convert<String>(json['companyCode']);
  if (companyCode != null) {
    interlockRemovalLedgerEntity.companyCode = companyCode;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    interlockRemovalLedgerEntity.createBy = createBy;
  }
  final String? createById = jsonConvert.convert<String>(json['createById']);
  if (createById != null) {
    interlockRemovalLedgerEntity.createById = createById;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    interlockRemovalLedgerEntity.createDate = createDate;
  }
  final String? deleted = jsonConvert.convert<String>(json['deleted']);
  if (deleted != null) {
    interlockRemovalLedgerEntity.deleted = deleted;
  }
  final String? endDate = jsonConvert.convert<String>(json['endDate']);
  if (endDate != null) {
    interlockRemovalLedgerEntity.endDate = endDate;
  }
  final String? equipmentId = jsonConvert.convert<String>(json['equipmentId']);
  if (equipmentId != null) {
    interlockRemovalLedgerEntity.equipmentId = equipmentId;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    interlockRemovalLedgerEntity.id = id;
  }
  final String? innerLockId = jsonConvert.convert<String>(json['innerLockId']);
  if (innerLockId != null) {
    interlockRemovalLedgerEntity.innerLockId = innerLockId;
  }
  final String? inspector = jsonConvert.convert<String>(json['inspector']);
  if (inspector != null) {
    interlockRemovalLedgerEntity.inspector = inspector;
  }
  final String? inspectorId = jsonConvert.convert<String>(json['inspectorId']);
  if (inspectorId != null) {
    interlockRemovalLedgerEntity.inspectorId = inspectorId;
  }
  final String? name = jsonConvert.convert<String>(json['name']);
  if (name != null) {
    interlockRemovalLedgerEntity.name = name;
  }
  final String? removalReason = jsonConvert.convert<String>(json['removalReason']);
  if (removalReason != null) {
    interlockRemovalLedgerEntity.removalReason = removalReason;
  }
  final String? startDate = jsonConvert.convert<String>(json['startDate']);
  if (startDate != null) {
    interlockRemovalLedgerEntity.startDate = startDate;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    interlockRemovalLedgerEntity.updateBy = updateBy;
  }
  final String? updateById = jsonConvert.convert<String>(json['updateById']);
  if (updateById != null) {
    interlockRemovalLedgerEntity.updateById = updateById;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    interlockRemovalLedgerEntity.updateDate = updateDate;
  }
  return interlockRemovalLedgerEntity;
}

Map<String, dynamic> $InterlockRemovalLedgerEntityToJson(InterlockRemovalLedgerEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['auditStatus'] = entity.auditStatus;
  data['companyCode'] = entity.companyCode;
  data['createBy'] = entity.createBy;
  data['createById'] = entity.createById;
  data['createDate'] = entity.createDate;
  data['deleted'] = entity.deleted;
  data['endDate'] = entity.endDate;
  data['equipmentId'] = entity.equipmentId;
  data['id'] = entity.id;
  data['innerLockId'] = entity.innerLockId;
  data['inspector'] = entity.inspector;
  data['inspectorId'] = entity.inspectorId;
  data['name'] = entity.name;
  data['removalReason'] = entity.removalReason;
  data['startDate'] = entity.startDate;
  data['updateBy'] = entity.updateBy;
  data['updateById'] = entity.updateById;
  data['updateDate'] = entity.updateDate;
  return data;
}

extension InterlockRemovalLedgerEntityExtension on InterlockRemovalLedgerEntity {
  InterlockRemovalLedgerEntity copyWith({
    int? auditStatus,
    String? companyCode,
    String? createBy,
    String? createById,
    String? createDate,
    String? deleted,
    String? endDate,
    String? equipmentId,
    String? id,
    String? innerLockId,
    String? inspector,
    String? inspectorId,
    String? name,
    String? removalReason,
    String? startDate,
    String? updateBy,
    String? updateById,
    String? updateDate,
  }) {
    return InterlockRemovalLedgerEntity()
      ..auditStatus = auditStatus ?? this.auditStatus
      ..companyCode = companyCode ?? this.companyCode
      ..createBy = createBy ?? this.createBy
      ..createById = createById ?? this.createById
      ..createDate = createDate ?? this.createDate
      ..deleted = deleted ?? this.deleted
      ..endDate = endDate ?? this.endDate
      ..equipmentId = equipmentId ?? this.equipmentId
      ..id = id ?? this.id
      ..innerLockId = innerLockId ?? this.innerLockId
      ..inspector = inspector ?? this.inspector
      ..inspectorId = inspectorId ?? this.inspectorId
      ..name = name ?? this.name
      ..removalReason = removalReason ?? this.removalReason
      ..startDate = startDate ?? this.startDate
      ..updateBy = updateBy ?? this.updateBy
      ..updateById = updateById ?? this.updateById
      ..updateDate = updateDate ?? this.updateDate;
  }
}
